package com.evil.account.api;

import com.evil.account.config.FeignErrorDecoder;
import com.evil.account.pojo.dto.enterprise.EnterpriseBaseInfoResp;
import com.evil.common.account.dto.user.*;
import com.evil.common.account.dto.user.enterprise.EnterpriseUsersReqDTO;
import com.evil.common.account.dto.user.enterprise.MineEnterprisesReqDTO;
import com.evil.common.core.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 用户企业接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.ACCOUNT_SERVICE, configuration = {FeignErrorDecoder.class})
public interface RemoteUserEnterpriseService {

    /**
     * 获取当前用户企业列表
     *
     * @return BaseEnterpriseDTO
     */
    @PostMapping("/remote/user/enterprise/mine-enterprises")
    List<EnterpriseBaseInfoResp> mineEnterprises(@Validated @RequestBody MineEnterprisesReqDTO mineEnterprisesReqDTO);

    /**
     * 获取企业用户ids
     *
     * @param findUserIdsByIdReqDTO findUserIdsByIdReqDTO
     * @return BaseEnterpriseDTO
     */
    @PostMapping("/remote/user/enterprise/user-ids")
    List<Long> enterpriseUserIds(@Validated @RequestBody FindUserIdsByIdReqDTO findUserIdsByIdReqDTO);

    /**
     * 检查企业正常用户
     *
     * @param checkEnterpriseUserIdsReqDTO checkEnterpriseUserIdsReqDTO
     * @return BaseEnterpriseDTO
     */
    @PostMapping("/remote/user/enterprise/check-ids")
    List<Long> checkEnterpriseUserIds(@Validated @RequestBody CheckEnterpriseUserIdsReqDTO checkEnterpriseUserIdsReqDTO);

    /**
     * 获取企业用户基础信息列表
     *
     * @param findUserIdsByIdReqDTO findUserIdsByIdReqDTO
     * @return BaseEnterpriseDTO
     */
    @PostMapping("/remote/user/enterprise/user-bases")
    List<UserBaseRespDTO> enterpriseUserBases(@Validated @RequestBody FindUserIdsByIdReqDTO findUserIdsByIdReqDTO);

    /**
     * 设置用户在当前企业中是否禁用
     *
     * @param enableUsersReqDTO enableUserReqDTO
     */
    @PostMapping("/remote/user/enterprise/enable")
    void enable(@Validated @RequestBody EnableUsersReqDTO enableUsersReqDTO);

    /**
     * 删除用户在当前企业的信息
     *
     * @param enterpriseUsersReqDTO enterpriseUsersReqDTO
     */
    @PostMapping("/remote/user/enterprise/batch-delete")
    void deleteUserEnterpriseBatch(@Validated @RequestBody EnterpriseUsersReqDTO enterpriseUsersReqDTO);

    /**
     * 检查企业人员状态
     *
     * @param userEnterpriseDTO userEnterpriseDTO
     */
    @PostMapping("/remote/user/enterprise/check")
    void checkEnterpriseUser(@Validated @RequestBody UserEnterpriseDTO userEnterpriseDTO);

    /**
     * 是否企业管理员
     *
     * @param userEnterpriseDTO userEnterpriseDTO
     * @return boolean
     */
    @PostMapping("/remote/user/enterprise/is-manager")
    Boolean enterpriseManager(@Validated @RequestBody UserEnterpriseDTO userEnterpriseDTO);

    /**
     * 检查企业管理员
     *
     * @param userEnterpriseDTO userEnterpriseDTO
     */
    @PostMapping("/remote/user/enterprise/check-manager")
    void checkEnterpriseManager(@Validated @RequestBody UserEnterpriseDTO userEnterpriseDTO);
}
